<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人信息管理</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <script src="../layui/layui.js"></script>
    <script >
        layui.use(['layer','jquery','form'],function () {
            let layer = layui.layer;//定义组件
            let $ = layui.jquery;//定义组件
            let form = layui.form;//定义表单组件
            form.on('submit(infor-submit)', function (data) {
                console.log(data.field);
                $.post('../admin/update',data.field,function (flag) {
                    if(flag){
                        layer.msg('修改成功',{icon:6});
                    }else{
                        layer.msg('修改失败',{icon:5});
                    }
                })
                return false;//阻住提交表单标签action属性值
                }
            )
        })

</script>
</head>
<body>
<form class="layui-form">
    <div class="layui-form-item">
        <label class="layui-form-label">管理员姓名</label>
        <div class="layui-input-block" style="margin-bottom: 50px">
            <input style="width: 300px" type="text" name="adminname" required  lay-verify="required" placeholder="请输入姓名" class="layui-input">
        </div>
        <label class="layui-form-label">管理员电话</label>
        <div class="layui-input-block" style="margin-bottom: 50px">
            <input  style="width: 300px" type="text" name="tel" required  lay-verify="required" placeholder="请输入电话" class="layui-input">
        </div>
        <label class="layui-form-label">管理员邮箱</label>
        <div class="layui-input-block" style="margin-bottom: 50px">
            <input style="width: 300px"  type="text" name="email" required  lay-verify="required" placeholder="请输入邮箱" class="layui-input">
        </div>
        <div class="layui-input-block" style="margin-bottom: 50px">
            <button lay-submit  class="layui-btn layui-btn-lg layui-btn-normal" lay-filter="infor-submit">修改</button>
            <button  type="reset" class="layui-btn layui-btn-lg layui-btn-normal">重置</button>
        </div>
    </div>
</form>
</body>
</html>